package com.ai.bitcoin.service.impl;

import com.ai.bitcoin.constant.CodeConstant;
import com.ai.bitcoin.jpa.dao.BccSubPackageDao;
import com.ai.bitcoin.jpa.entity.BccSubPackage;
import com.ai.bitcoin.output.GeneralReponse;
import com.ai.bitcoin.service.SubPackageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class SubPackageServiceImpl implements SubPackageService {

    @Autowired
    private BccSubPackageDao bccSubPackageDao;

    @Override
    public GeneralReponse pack() {
        List<BccSubPackage> packages = bccSubPackageDao.findByTypeAndStatusOrderByOrderNoAsc(1,1);
        return new GeneralReponse(CodeConstant.SUCCESS,packages);
    }
}
